package com.huawei.appgallery.assistantdock.buoydock.uikit.navigator;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.LinearLayout;
import o.beo$a;
import o.Logger;
import o.epr;
import o.epv;

public class NavigatorMaxWidthLinearLayout extends LinearLayout {
    private int ˊ;
    private int ˋ = 2;

    public NavigatorMaxWidthLinearLayout(Context context) {
        super(context);
        ॱ();
    }

    public NavigatorMaxWidthLinearLayout(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
        ॱ();
    }

    public NavigatorMaxWidthLinearLayout(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        ॱ();
    }

    public void setColumnCount(int i) {
        this.ˋ = i;
        if (i > 2) {
            setPadding(epv.ˋ(getContext(), 16), 0, epv.ˋ(getContext(), 16), 0);
        }
    }

    private void ॱ() {
        this.ˊ = Math.round(getResources().getDimension(beo$a.ॱ));
    }

    protected void onMeasure(int i, int i2) {
        try {
            if (this.ˋ == 2) {
                if (epr.ˎ().ॱॱ()) {
                    this.ˊ = (epv.ˎ(getContext()) - epv.ˋ(getContext(), 48)) / 2;
                } else {
                    this.ˊ = ((epv.ˎ(getContext()) - epv.ˋ(getContext(), 32)) * 2) / 3;
                }
                i = MeasureSpec.makeMeasureSpec(this.ˊ, 1073741824);
            }
        } catch (Throwable e) {
            Logger.ˋ("MaxWidthLinearLayout", "onMeasure error", e);
        }
        super.onMeasure(i, i2);
    }
}
